package com.company.loganalyzer.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * 简化版健康检查控制器
 */
@RestController
@RequestMapping("/api/v1")
public class SimpleHealthController {

    @GetMapping("/health")
    public Map<String, Object> health() {
        Map<String, Object> response = new HashMap<>();
        response.put("status", "UP");
        response.put("timestamp", LocalDateTime.now().toString());
        
        Map<String, String> details = new HashMap<>();
        details.put("application", "日志分析助手");
        details.put("version", "2.0.0");
        details.put("phase", "阶段二测试");
        response.put("details", details);
        
        return response;
    }

    @GetMapping("/info")
    public Map<String, Object> info() {
        Map<String, Object> response = new HashMap<>();
        response.put("application", "日志分析助手 Spring Boot");
        response.put("version", "2.0.0");
        response.put("timestamp", LocalDateTime.now().toString());
        
        Map<String, String> status = new HashMap<>();
        status.put("phase", "阶段二：核心工具迁移测试");
        status.put("llm", "暂时禁用");
        status.put("elasticsearch", "7.17.29");
        response.put("status", status);
        
        return response;
    }
}